package com.example.administrator.School.fragment;
import android.content.DialogInterface;
import android.content.Intent;
import android.view.View;

import com.example.administrator.School.DetailActivity;
import com.example.administrator.School.DutyActivity;
import com.example.administrator.School.KaoQinActivity;
import com.example.administrator.School.R;
import com.example.administrator.School.adpter.HorizontalListView;
import com.example.administrator.School.adpter.HorizontalListViewAdapter;
import com.example.administrator.School.until.BaseFragment;
import com.example.administrator.School.until.FaceDialog;
import butterknife.OnClick;


public class BlankFragment extends BaseFragment implements View.OnClickListener{
    public HorizontalListView hListView;
    HorizontalListViewAdapter hListViewAdapter;

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_blank;
    }
    @Override
    protected void initWidget(View root) {
        super.initWidget(root);

        hListView = (HorizontalListView) root.findViewById(R.id.horizon_listview);
        String[] titles = {"怀师", "南怀瑾军校", "闭关", "南怀瑾", "南公庄严照", "怀师法相"};
        final int[] ids = {R.drawable.ic_launcher, R.drawable.ic_launcher,
                R.drawable.ic_launcher, R.drawable.ic_launcher,
                R.drawable.ic_launcher, R.drawable.ic_launcher};
        hListViewAdapter = new HorizontalListViewAdapter(getActivity(),titles,ids);
        hListView.setAdapter(hListViewAdapter);
    }

    @OnClick(R.id.face)
    void face(){
        //刷脸
        FaceDialog.Builder builder = new FaceDialog.Builder(getContext());
//        builder.setMessage("这个就是自定义的提示框");
//        builder.setTitle("提示");
        builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
                //设置你的操作事项
            }
        });

        builder.setNegativeButton("取消",
                new android.content.DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();
                    }
                });
        builder.create().show();
    }
    //进入考勤页面
    @OnClick(R.id.kaoqin)
    void kaoqin(){
        startActivity(new Intent(getContext(), KaoQinActivity.class));
    }
    //进入值日页面
    @OnClick(R.id.zhiri)
    void zhiri(){
        startActivity(new Intent(getContext(), DutyActivity.class));
    }
    //进入详情事件
    @OnClick(R.id.detail)
    void detail(){
        startActivity(new Intent(getContext(), DetailActivity.class));
    }

    @Override
    protected void initData() {
        super.initData();
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    @Override
    public void onPause() {
        super.onPause();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }
    @Override
    public void onClick(View v) {

    }


}
